package com.many.common.enums;

/**
 *
 * @author hui.peng
 *
 * 2017年9月12日
 *
 */
public enum ErrorCode {
	SUCCESS("200", "success"),
    NOT_THE_OPEN("401","機器人開啟時間週一至週五18:00～21:00"),
	FAIL("402", "操作失敗"),
	EEROR_INVALID_PARAM("403", "參數值不完整!"),//全局ERROR，需要重新设置message
	ERROR_EXCEPTION("405", "服務器內部錯誤!"),//全局ERROR, 有异常Exception被抛出时
	ERROR_ARGS_EXCEPTION("406", "傳的參數不合法!"),
	ERROR_OBJECT_EXIST("407", "操作對象已存在!"),
	ERROR_OBJECT_NOT_EXIST("408", "操作對象不存在!"),
    ERROR_RECEIVE_IS_EXIST("409", "該分紅已結算!"),
    ERROR_DELIVERY_NOT_FINISH("410", "今日派件未結束，請於派件結束後結算!"),
    ERROR_NOT_SETTLED_YESTERDAY("411", "昨日分紅未結算!"),
    NOT_THE_CLOSE("412", "機器人開啓後不可關閉！"),
    NOT_THE_OPEN_NOTMONEY("413", "賬戶餘額爲零，無法開啓！"),
    NOT_THE_OPEND_CONTRACT("414", "未開通合約，無法開啓！"),
    DID_NOT_OPEN("415", "未開市，無法交易！");
    private String value;

    protected String message;

    private ErrorCode(String value, String message) {
        this.setValue(value);
        this.message = message;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String appendMessage(String message) {
        return this.getMessage() + ":" + message;
    }

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
}

